GBML manual / Constants

SPRITE_BULGE

The middle of the picture stays full size and both the top and the bottom shrink away - like a picture wrapped round a barrel.

Works differently on Game Boy - The Game Boy narrows the picture on some lines by moving its two sprite pieces toward each other (the middle is covered, not squeezed), a drum or a band hides it outside the lens; 16 pixels wide at most, one picture at a time; the size is not used.

Works differently on Game Boy Color - The Game Boy Color narrows the picture on some lines by moving its two sprite pieces toward each other (the middle is covered, not squeezed), a drum or a band hides it outside the lens; 16 pixels wide at most, one picture at a time; the size is not used.

Sega Genesis: not built yet

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

SPRITE_BULGE: constant

Description

Names the barrel shape, for draw_sprite_3d and draw_sprite_3d_scaled: the middle of the picture stays full size and both the top and the bottom shrink away, like a picture printed on a barrel. It is the sprite's own name for the curve TEXT_BULGE gives a line of text.

A real capture - a flat striped lighthouse on the left of each picture, and on the right the same lighthouse drawn with SPRITE_BULGE at depth 1, 2 and 3. The deeper it goes, the narrower the top and bottom of the curved lighthouse get compared with its middleA real capture - a flat striped lighthouse on the left of each picture, and on the right the same lighthouse drawn with SPRITE_BULGE at depth 1, 2 and 3. The deeper it goes, the narrower the top and bottom of the curved lighthouse get compared with its middle
A real capture - a flat striped lighthouse on the left of each picture, and on the right the same lighthouse drawn with SPRITE_BULGE at depth 1, 2 and 3. The deeper it goes, the narrower the top and bottom of the curved lighthouse get compared with its middle

In each picture the flat lighthouse (plain draw_sprite) is on the left and the bulge, at depth 1, 2 and then 3, is on the right. A tall striped lighthouse stands in for the example's spr_doc_tower. Real pictures from a Game Boy Advance ROM.

A real capture, 12 frames played in a loop - a plain striped lighthouse on the left stands still while the one on the right is drawn with SPRITE_BULGE while the depth goes 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1 and 2. At depth 3 the top and bottom are clearly narrower than the middle, and at depth 0 the curved lighthouse is just the same as the flat one. The first frame, which is all a viewer that cannot animate shows, is depth 3, the page's example.A real capture, 12 frames played in a loop - a plain striped lighthouse on the left stands still while the one on the right is drawn with SPRITE_BULGE while the depth goes 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1 and 2. At depth 3 the top and bottom are clearly narrower than the middle, and at depth 0 the curved lighthouse is just the same as the flat one. The first frame, which is all a viewer that cannot animate shows, is depth 3, the page's example.
A real capture, 12 frames played in a loop - a plain striped lighthouse on the left stands still while the one on the right is drawn with SPRITE_BULGE while the depth goes 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1 and 2. At depth 3 the top and bottom are clearly narrower than the middle, and at depth 0 the curved lighthouse is just the same as the flat one. The first frame, which is all a viewer that cannot animate shows, is depth 3, the page's example.

The same call with only depth changing (the line under the picture says which depth): twelve real pictures played in a loop, each held for about a third of a second. The plain lighthouse on the left is draw_sprite and never changes. A viewer that does not animate shows the first frame, depth 3.

A sprite's bulge goes from depth 1 (gentle) to depth 3 (deep): the far edge is drawn at about 80%, 67% and 57% of its width. A bigger number is treated as 3. Read draw_sprite_3d for why a sprite stops at 3, and what the call costs.

Example

draw_sprite_3d(spr_doc_tower, x, y, 0, SPRITE_BULGE, 3);

The tower, pinched at the top and bottom like a barrel seen close up.

See also: draw_sprite_3ddraw_sprite_3d_scaledTEXT_BULGESPRITE_LEAN_BACKSPRITE_LEAN_FORWARDSPRITE_DRUM